blob: 5ebc44469a964ed530aad046e5362e78c837da05 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import { useLocalSearchParams, Stack } from "expo-router";
import { View } from "react-native";
import BookmarkList from "@/components/bookmarks/BookmarkList";
import { api } from "@/lib/trpc";
export default function ListView() {
const { slug } = useLocalSearchParams();
if (typeof slug !== "string") {
throw new Error("Unexpected param type");
}
const { data: list } = api.lists.get.useQuery({ listId: slug });
if (!list) {
// TODO: Spinner
return <View />;
}
return (
<>
<Stack.Screen
options={{
headerTitle: `${list.icon} ${list.name}`,
}}
/>
<View>
<BookmarkList archived={false} ids={list.bookmarks} />
</View>
</>
);
}
|